#pragma once

#include "vrdatacore_global.h"
#include <QTimer>
#include <osg/vec4>
#include <osg/vec3>

namespace osg
{
	class Object;
}

namespace CoreBase
{
	class ActorBase;
}

namespace VrDataCore
{
	class CoreBase::ActorBase;

	class VRDATACORE_EXPORT ExtTimer: public QTimer
	{
		Q_OBJECT
	public:
		ExtTimer(QObject *parent = 0);
		~ExtTimer(void);
	public:
		void timeOutNow();
		void setTimeOut(float num);
		float getTimerOut() const;
		void addInterval();
		float getTotalTime() const;
		void setBindingNode(osg::Object* pnode);
		osg::Object* getBindingNode() const;
		void setBindingActor(CoreBase::ActorBase* proxy);
		CoreBase::ActorBase* getBindingActor() const;
		void setVec4Data(const osg::Vec4& vec4);
		osg::Vec4 getVec4Data() const;
		void setVec3Data(const osg::Vec3& data);
		osg::Vec3 getVec3Data() const;
		virtual void startTimer();
	protected:
		osg::Object*							_node;
		CoreBase::ActorBase*					_actor;
		float									_num;
		float									_totalTime;
		osg::Vec4								_vec4Data;
		osg::Vec3								_vec3Data;
	};
}